﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Iit.ITBI.MDSManager;

namespace Iit.ITBI.MDSManagerService
{
    public static class DebugConsole
    {
        
        public static void Run()
        {

            MasterEntityReplicator masterEntityReplicator = new MasterEntityReplicator();

            masterEntityReplicator.OnInfo += masterEntityReplicator_OnInfo;
            masterEntityReplicator.OnWarning += masterEntityReplicator_OnWarning;
            masterEntityReplicator.OnError += masterEntityReplicator_OnError;
            
            Console.WriteLine("Start to replicate");

            masterEntityReplicator.Replicate();

            Console.WriteLine("Replication ended");
            Console.WriteLine();

            Console.WriteLine("Press any key to exit");
            Console.ReadLine();
        }

        private static void masterEntityReplicator_OnInfo(object sender, MessageEventArgs e)        
        {
            Console.WriteLine(e.Message);
        }

        private static void masterEntityReplicator_OnError(object sender, MessageEventArgs e)
        {
            Console.WriteLine(e.Message);
        }

        private static void masterEntityReplicator_OnWarning(object sender, MessageEventArgs e)
        {
            Console.WriteLine(e.Message);
        }
        



    }
}
